﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace JustTest.Models
{
    public class Question
    {
        public int Id { get; set; }

        [Range(0, 100,
            ErrorMessage = "Number must be between 1 and 100")]
        [Required(ErrorMessage = "Question number is required.")]
        public int Number { get; set; }

        [StringLength(300, ErrorMessage = "Question content must be 300 characters or less in length.")]
        [Required(ErrorMessage = "Question content is required.")]
        public string Content { get; set; }
        public virtual ICollection<Answer> Answers { get; set; }
        public virtual Test Test { get; set; }

        public Question()
        {
            this.Answers = new HashSet<Answer>();
        }
    }
}